package com.aabte.commons.bean;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/4/30
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseResponse<T> {

    private static String providerId = "";

    public static String getProviderId() {
        return providerId;
    }

    public static void setProviderId(String providerId) {
        BaseResponse.providerId = providerId;
    }

    private String provider = providerId;
    private Integer code;
    private String message;
    private T data;

    @Builder
    public BaseResponse(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public BaseResponse(Integer code, String message) {
        this(code, message, null);
    }
}
